/*
package com.dianshang.controller;

import com.dianshang.entity.Result;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

*/
/**
 * 统一异常处理类
 *//*

@ControllerAdvice // 控制器增强
public class BaseExceptionHandler {

    @ExceptionHandler(Exception.class)
    @ResponseBody
    public Result error(Exception e){
        e.printStackTrace();
        // 记录日志
        System.out.println("调用了公共异常处理类");
        // 返回通用异常
        return new Result(1,e.getMessage());
    }

}
*/